<?php
/**
 * Created by 784855684@qq.com.
 * Link: https://github.com/lichtung/wshore
 * User: linzh
 * Date: 7/12/17
 * Time: 10:49 AM
 */
declare(strict_types=1);


namespace application\service\library\socket;

/**
 *
 * Class Message 代表通信过程中的消息体部
 *
 * @property string $from
 * @property string $to
 * @property int $type
 * @property string $content
 *
 * @package application\service\library\socket
 */
class Message
{
    /**
     * @var array 消息的组成部分
     */
    protected $data = [];

    public function __construct(array $info)
    {
        $this->info = $info;
    }

    public function __get($name)
    {
        return $this->data[$name]??null;
    }

    public function __set($name, $value)
    {
        $this->data[$name] = $value;
    }


}